Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • pike pike
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 107
    • Issues 107
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pikelang
  • pikepike
  • Issues
  • #10096

aggregate_mapping() type checker performance issue

Pike v8.1 release 18 running Hilfe v3.5 (Incremental Pike Frontend)
> int t = gethrtime(); typeof(([ 1: `==, 2:`<=, 4: `< ])); gethrtime() - t;
(1) Result: mapping(int(1..2) | int(4):function(int | float ... : int(1bit)) | function(string ... : int(1bit)) | function(program | type(mixed), program | type(mixed), program | type(mixed) ... : int(1bit)) | scope(0,function(int | float, int | float, int | float ... : int(1bit)) | function(($0=array | mapping | multiset | string), $0, $0 ... : int(1bit)) | function(function | object | program, mixed, mixed ... : int(1bit)) | function(mixed, function | object | program, mixed ... : int(1bit)) | function(type(mixed), type(mixed), function | program | type(mixed) ... : int(1bit)) | function(($0=array | mapping | multiset | string), ~$0 ... : zero)) | ~function(~mixed ... : mixed) & function(mixed ... : int(1bit)))
(2) Result: 40760
> int t = gethrtime(); typeof(([ 1:`==, 2: `<=, 4: `<, 5: `> ])); gethrtime() - t;
(3) Result: mapping(int(1..2) | int(4..5):function(int | float ... : int(1bit)) | function(string ... : int(1bit)) | function(program | type(mixed), program | type(mixed), program | type(mixed) ... : int(1bit)) | scope(0,function(int | float, int | float, int | float ... : int(1bit)) | function(($0=array | mapping | multiset | string), $0, $0 ... : int(1bit)) | function(function | object | program, mixed, mixed ... : int(1bit)) | function(mixed, function | object | program, mixed ... : int(1bit)) | function(type(mixed), type(mixed), function | program | type(mixed) ... : int(1bit)) | function(($0=array | mapping | multiset | string), ~$0 ... : zero)) | ~function(~mixed ... : mixed) & function(mixed ... : int(1bit)))
(4) Result: 42070381

The time taken for the second statement is ~42 seconds (~1000 times slower than the first). Doing

> int t = gethrtime(); typeof(([ 1:`==, 2: `<=, 3: `!=, 4: `<, 5: `> ])); gethrtime() - t;

essentially hangs the compiler.

Assignee
Assign to
Time tracking