Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] type-safe air node by defnode #91

Merged
merged 48 commits into from
Sep 17, 2024
Merged

Conversation

hikettei
Copy link
Owner

@hikettei hikettei commented Sep 16, 2024

  • Pass all tests w/ VM=1
  • Use placeholder instead of (car node-writes ...) ?
  • we do not want to initialize a numerous amount of CLOS classes
  • fix for double-float in ccl
  • docgen
  • Check they are dumpable and merge

@hikettei
Copy link
Owner Author

hikettei commented Sep 16, 2024

Initializing attributes 1000000 times, thanks to SBCL's optimization, is much faster than even making nodes.

CATEN/AASM> (time
	     (dotimes (i 1000000)
	       (make-node :A :A nil nil)))
Evaluation took:
  0.104 seconds of real time
  0.103185 seconds of total run time (0.100795 user, 0.002390 system)
  99.04% CPU
  288,025,856 bytes consed
  
NIL
CATEN/AASM> (time
	     (dotimes (i 1000000)
	       (make-instance 'NEG-Attr :_type_relay t)))
Evaluation took:
  0.013 seconds of real time
  0.013103 seconds of total run time (0.012579 user, 0.000524 system)
  100.00% CPU
  41 lambdas converted
  112,890,368 bytes consed
  
NIL
CATEN/AASM> (time
	     (dotimes (i 1000000)
	       (make-instance 'NEG-Attr :_type_relay t)))
Evaluation took:
  0.009 seconds of real time
  0.009780 seconds of total run time (0.009761 user, 0.000019 system)
  111.11% CPU
  111,973,680 bytes consed
  
NIL
CATEN/AASM>  (defstruct (Hoge) (x 1) (y 1))
CATEN/AASM> (time
	     (dotimes (i 1000000)
	       (make-hoge)))
Evaluation took:
  0.007 seconds of real time
  0.007072 seconds of total run time (0.003108 user, 0.003964 system)
  100.00% CPU
  32,047,104 bytes consed

@hikettei hikettei changed the title [Refactor] Type-safe air Node [Refactor] type-safe air node by defnode Sep 16, 2024
@hikettei
Copy link
Owner Author

No significant performance decrease were seen in main vs this PR
main:
JIT=1

* (time (caten (!rand `(n))))
Evaluation took:
  4.672 seconds of real time
  4.187063 seconds of total run time (4.103280 user, 0.083783 system)
  89.62% CPU
  48 forms interpreted
  231 lambdas converted
  176,127,920 bytes consed

This PR

CATEN> (time (caten (!rand `(n))))
Evaluation took:
  5.627 seconds of real time
  4.535812 seconds of total run time (4.094729 user, 0.441083 system)
  80.61% CPU
  48 forms interpreted
  231 lambdas converted
  182,998,464 bytes consed

@hikettei
Copy link
Owner Author

JIT=0
main:

* Evaluation took:
  2.872 seconds of real time
  2.729233 seconds of total run time (2.692141 user, 0.037092 system)
  95.02% CPU
  138,688,272 bytes consed
CATEN> (time (caten (!rand `(n))))
Evaluation took:
  2.822 seconds of real time
  2.728588 seconds of total run time (2.671705 user, 0.056883 system)
  96.70% CPU
  143,662,192 bytes consed

@hikettei hikettei marked this pull request as ready for review September 16, 2024 15:04
@hikettei hikettei merged commit 5cf2e28 into main Sep 17, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant